package main;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

import javax.swing.JOptionPane;

public class Messages {
	
	private static final String BUNDLE_NAME = "main.messages"; //$NON-NLS-1$

	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
			.getBundle(BUNDLE_NAME);

	private Messages() {
	}

	public static String getString(String key) {
		try {
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return '!' + key + '!';
		}
	}
	
	public static void showInfoMessage(String message){
		JOptionPane.showMessageDialog(null, getString(message), 
				getString("URL4BibTeX.Constants.appName"), JOptionPane.INFORMATION_MESSAGE); 
		
	}
	
	public static void showErrorMessage(String message){
		JOptionPane.showMessageDialog(null, getString(message), 
				getString("URL4BibTeX.Constants.appName"), JOptionPane.ERROR_MESSAGE); 
		
		
	}
}
